require(['monitor'], function () {
	
    $('#monitor').monitor({
        canId: '26',
        onlyOnce: true,
        callback: function (data) {
        	 loadData(data);
        }
    });
    
	function loadData(data) {
        $("#dcpowerClass").setViewData(data, 'id');
        $("#controllerSt").setView(data.controllerSt, [
            {value: 4, css: 'green', text: '控制电源接通'},
            {value: 0, css: 'green', text: '就绪'},
            {value: 7, css: 'green', text: '诊断和标定'},
            {value: 5, css: 'red', text: '故障'}
        ]);
        $("#workSt").setView(data.workSt, [
            {value: 7, css: 'red', text: '停机'},
            {value: 8, css: 'green', text: '充电'},
            {value: 9, css: 'green', text: '充电完成'}
        ]);
        $("#errorLevel").setView(data.errorLevel, [
            {value: 0, text: '-'},
            {value: 1, css: 'red', text: '一级故障（严重故障）'},
            {value: 2, css: 'red', text: '二级故障（普通故障）'},
            {value: 3, css: 'red', text: '三级故障（报警故障）'}
        ]);
        $("#coolSt").setView(data.coolSt, [
            {value: 0, css: 'red', text: '关闭'},
            {value: 1, css: 'green', text: '开启'}
        ]);
	}
	
});